package com.easyhouse.common.utils;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.TimeZone;

public class TimeUtils {
    public static Date getTime(String time){
        SimpleDateFormat timeFormat =   new SimpleDateFormat( "yyyy-MM-dd HH:mm:ss" );
        timeFormat.setTimeZone(TimeZone.getTimeZone("Asia/Shanghai"));
        try {
            Date date = timeFormat.parse(time);
            return date;
        } catch (ParseException e) {
            e.printStackTrace();
            return null;
        }
    }
    public static long getTime(Date date){
        long time = date.getTime();
        return time;
    }
}
